require "#{__dir__}/base"
module Singularity
  module API
    class Authorize < Singularity::API::Base
      def login(login, password, params={})
        user = @token.post('/api/accounts/login', params: {username: login, password: password}.merge(params))
        Slient.user_info_callback_block.call user.parsed if user.error.nil?
        user
      end
    end
  end
end
